import request from '@/utils/request'
import {SysDeptDomain} from '@/type.d/system/dept';

// 查询部门列表
export function listDept(query: SysDeptDomain) {
  return request('/system/dept/list',{
    method: 'get',
    params: query
  })
}

// 查询部门详细
export function getDept(deptId: string) {
  return request('/system/dept/' + deptId,{
    method: 'get'
  })
}

// 新增部门
export function addDept(data: SysDeptDomain) {
  return request('/system/dept',{
    method: 'post',
    data: data
  })
}

// 修改部门
export function updateDept(data: SysDeptDomain) {
  return request('/system/dept',{
    method: 'put',
    data: data
  })
}

// 删除部门
export function delDept(deptId: string) {
  return request('/system/dept/' + deptId,{
    method: 'delete'
  })
}
// 查询下拉树结构
export function treeselect(data: SysDeptDomain) {
  return request('/system/dept/treeselect',{
    method: 'get',
    params: data
  })
}
